body {
  margin: 0;
  background-color: #f1f9f9;
}

#container {
  width: 600px;
  margin: 80px auto;  
  grid-template-columns: repeat(3, 1fr);
  counter-reset: increment;
}

.gd {
  display: grid;
}

.toggle-button-container {
  position: relative;
  width: 200px;
  height: 140px;
  box-sizing: border-box;
}

.toggle-button {
  position: relative;
  height: 100px;
  margin: 20px;
  background-color: #fff;
  box-shadow: 0 10px 20px -8px #c5d6d6;
  border-radius: 4px;
  /* border: #c5d6d6 1px solid; */
}

.toggle-button::before {
  counter-increment: increment;
  content: counter(increment);
  position: absolute;
  bottom: 0;
  right: 0;
  color: #d7e3e3;
  font-size: 12px;
  line-height: 1;
  padding: 5px;
}

.knob, 
.btn-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.btn {
  position: relative;
  top: 50%;
  margin: -20px auto 0 auto;
  width: 74px;
  height: 36px;
  background-color: aquamarine;
  overflow: hidden;
}

.btn-pill, .box-bg{
  border-radius: 50px;
}

.checkbox {
  border: none;
  outline: none;
  z-index: 4;
  background-color: none;
  flex: 1;
  opacity: 0;
}

.btn-bg {
  z-index: 1;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: aquamarine;
}

.knob {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.box, .knob, .btn-bg, .knob::before {
  transition: all 0.3s ease-in-out;
}

.knob::before {
  position: absolute;
  top: 4px;
  left: 4px;
  content: 'YES';
  font-size: 12px;
  line-height: 12px;
  padding: 8px 0;
  width: 32px;
  background-color: blue;
  border-radius: 100%;
}

#button-1 .checkbox:checked ~ .btn-bg {
  background-color: bisque;
}

#button-1 .checkbox:checked ~ .knob::before {
  position: absolute;
  top: 4px;
  left: 34px;
  content: 'NO';
  font-size: 12px;
  line-height: 12px;
  padding: 8px 0;
  width: 32px;
  background-color: red;
  border-radius: 100%;
  z-index: 3
}